package cn.edu.qfnu.common.service;

import cn.edu.qfnu.common.paginate.Pagination;
import org.hibernate.criterion.DetachedCriteria;

import java.io.Serializable;
import java.util.List;

public interface BaseService<T, ID extends Serializable> {

    void save(T entity);

    void removeById(ID id);

    void remove(T entity);

    void saveOrUpdate(T entity);

    void merge(T entity);

    T findById(ID id);

    List<T> query();

    List<T> queryPagedListByDetachedCriteria(DetachedCriteria detachedCriteria, Pagination pagination);

    List<T> queryByDetachedCriteria(DetachedCriteria detachedCriteria);
}
